Windows 環境配置案例分享

by Gene

配置方式:Windows 10 + Docker for Windows

  • Local server @ Docker in Windows
  • GAE deployment @ Docker in Windows
  • Editor: Visual Studio Code
  • Source code @ Windows
  • git @ Windows
  • 瀏覽器 @ Windows

我習慣 Windows 的作業環境,所以本篇基本上是能用 Windows 就用 Windows 的配置。只有 Local server 以及 GAE deployment 的部分會使用Docker的環境,省去 dependency 設定的麻煩。

Run Docker Container

Run docker container 時需要將 port forward 出來,並將硬碟 share 給 docker

docker run -it -v C:\Projects:/src -p 22:22 -p 8080:8080 -p 8000:8000 --name GAE jydeploy:v4 bash

8080/8000 是 local server 用

22 是連 ssh 用 (非必要,除非你覺得 Windows console 實在太爛,想要用 putty 連 ssh 進去才需要)

C:\Projects:/src 是將 C: 中的 code / database 檔案掛到 docker 的 /src 目錄中存取

Git

我個人習慣用 Git Extensions 來操作瀏覽 git

git 的部分獨立安裝 Git for Windows

Git Extensions 只安裝 GUI

需要 CLI 操作時可使用 Git Bash

gitconfig

symlinks 設定為 true,因為均一的 code 裡面有 symbolic link,需要設定為 true 才能在 Windows 下正確建立 link,另外要注意需要有 Windows admin 權限才可以建立 symbolic link

credential 設定為 wincred,使用 Windows 的密碼管理系統,就不用每次打帳號密碼

[user]
    name = ${USER_NAME}
    email = ${USER_EMAIL}
[core]
    symlinks = true
[credential]
    helper = wincred

results matching ""

    No results matching ""